package GradeQuery;

/**
 * @Author maojiangyue
 * @Date 2025/10/18
 * @Description 班级成绩
 */
public class ClassGrades {
    private int NumberOfStudents;
    private int[] StudentMarks;

    public ClassGrades(int[] StudentMarks) {
        this.StudentMarks = StudentMarks;
        this.NumberOfStudents = StudentMarks.length;
    }

    public int getGradeById(int i){
        if(i>NumberOfStudents){
            throw new IndexOutOfBoundsException("索引值越界异常");
        }
        return StudentMarks[i-1];
    }
}
